System and method of image augmentation

ABSTRACT

A method of augmenting a first stereoscopic image, comprising a pair of images, is provided. The method includes generating a disparity map from the pair of images of the first stereoscopic image. The disparity map is indicative of distances in the first stereoscopic image. The method further includes generating a virtual three-dimensional model responsive to the distances indicated by the disparity map, modeling an interaction of a virtual object with that three dimensional model, and outputting, for display, an image corresponding to the first stereoscopic image that comprises a visible effect of the interaction of the virtual object with the three dimensional model.

CROSS REFERENCE TO RELATED APPLICATIONS

The present application claims the benefit of and priority to GBApplication No. 1220219.8, filed Nov. 9, 2012, and GB Application No.1303299.0, filed Feb. 25, 2013 the entire disclosures of which areincorporated by reference herein.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention elates to a system and method of imageaugmentation.

2. Description of the Prior Art

The “background” description provided herein is for the purpose ofgenerally presenting the context of the disclosure. Work of thepresently named inventors, to the extent it is described in thisbackground section, as well as aspects of the description which may nototherwise qualify as prior art at the time of filing, are neitherexpressly or impliedly admitted as prior art against the presentinvention.

Many videogame consoles now have the option to use video cameras as aform of input, such as the PlayStation Eye® and the Microsoft Kinect®.Meanwhile, some consoles now also have the facility to generate 3Doutputs for use with 3D televisions. It would be preferable if these 3Denabled consoles could also use 3D video inputs of the player, from astereoscopic camera.

In addition to providing stereo images that may be optionally integratedinto a 3D videogame display, the coupling of a stereoscopic camera to avideogame console also provides additional information about the user'senvironment that may be of use for such integration or may provideinformation or constraints relevant to a videogame or other form oraugmented reality entertainment.

For example, by estimating the positions of the walls in a user's room,virtual objects in the display can be made to act in a manner consistentwith the extent of that room and with the user themselves, and/or theactions required by the user to play the game can be anticipated and thegame adjusted, to ensure that the player is not required to move througha wall or item of furniture to achieve a goal.

The present invention seeks to address or mitigate this need.

SUMMARY OF THE INVENTION

In a first aspect, a method of image reconstruction is provided inaccordance with claim 1.

In another aspect, an entertainment device for image reconstruction isprovided in accordance with claim 13.

Further respective aspects and features of the invention are defined inthe appended claims.

It is to be understood that both the foregoing general description ofthe invention and the following detailed description are exemplary, butare not restrictive, of the invention.

BRIEF DESCRIPTION OF THE DRAWINGS

A more complete appreciation of the disclosure and many of the attendantadvantages thereof will be readily obtained as the same becomes betterunderstood by reference to the following detailed description whenconsidered in connection with the accompanying drawings, wherein:

FIG. 1 is a schematic diagram of a stereoscopic pair of images.

FIG. 2 is a schematic plan view of a portion of a mesh generated fromthe stereoscopic pair of images.

FIGS. 3A to 3C are schematic plan views of a sequence of meshesgenerated from the stereoscopic pair of images in accordance with anembodiment of the present invention.

FIGS. 4A to 4C are schematic plan views of a sequence of meshesgenerated from the stereoscopic pair of images in accordance with anembodiment of the present invention.

FIG. 5A is a schematic diagram of a stereoscopic pair of images,indicating colour samples.

FIG. 5B is a schematic diagram of a texture to be interpolated inaccordance with an embodiment of the present invention.

FIG. 6 is a schematic diagram of an extrapolation of surfaces in a modelgenerated from the stereoscopic pair of images, in accordance with anembodiment of the present invention.

FIG. 7 is a schematic diagram of an entertainment device in accordancewith an embodiment of the present invention.

FIG. 8 is a flow diagram of a method of image augmentation in accordancewith an embodiment of the present invention.

DESCRIPTION OF THE EMBODIMENTS

A system and method of image augmentation are disclosed. In thefollowing description, a number of specific details are presented inorder to provide a thorough understanding of the embodiments of thepresent invention. It will be apparent, however, to a person skilled inthe art that these specific details need not be employed to practice thepresent invention. Conversely, specific details known to the personskilled in the art are omitted for the purposes of clarity whereappropriate.

Referring now to FIG. 1, this shows an example stereoscopic pair ofimages such as may be captured by a 3D video camera attached to aconsole. In the left and right images (denoted R and L in the figure), achild is performing actions in their living room in response to a videogame, and in each image a different viewpoint on the scene is captured.

However, it will be appreciated that a small area of the room behind thechild is not seen in either image, and similarly there are sections ofthe room behind the chair that are obscured. In order to potentiallydigitally recreate the room (for example to insert monsters to battle,or to rotate the room on screen to reveal treasure, or to apparentlybounce virtual objects on walls and/or furniture in the room, or toappropriately calculate the effects of a virtual light source on thecaptured video), it would be desirable to fill in the missing areaswithin a digital model of the room.

Hence in an embodiment of the present invention, as a preparatory stepthe left and right images can be rectified to line up vertically.

Next, a disparity map is generated, using one of several knowntechniques. A disparity map indicates the horizontal disparity betweencorresponding pixels in each image. Most techniques rely on some form oflocalised cross-correlation between regions of the two images, but anysuitable technique may be used.

The disparity map is an indirect indicator of distance between the 3Dvideo camera and a surface depicted in the image. For a pair of parallelaligned video cameras in a 3D video camera, it will be appreciated thatthe parallel lines converge at infinity and so at that distance therewould be no disparity. Meanwhile an object close to the cameras wouldshow significant horizontal disparity. Hence the degree of disparitycorresponds to the distance of the pixel from the camera.

Finally, a small object very close to the cameras may in fact notproperly appear in both images, and so the stereo disparity alsoeffectively imposes an operational near-distance limit on thestereoscopic effect.

However, for objects within the operational region of the device, thedisparity between these objects in the two images can be related totheir relative depth from the camera.

To generate a digital model of the scene one may calculate the depthinformation or ‘z’ value at each x, y point in the disparity map tocreate a notional point-cloud of (x,y) positions with associated ‘z’value data, and then define a mesh describing the room by, for example,Delaunay triangulation of the calculated (x,y) points or a subsamplethereof. This mesh can then be projected into 3D by adding theassociated ‘z’ value to the mesh.

Optionally, the disparity map can be pre-processed to improve thefidelity of the mesh. Firstly, disparity data for successive videoframes can be stored, and disparity values that are inconsistent betweenframes can be replaced. For example, if a patch of a wall appears tohave a different disparity in only one frame due to an autocorrelationerror (for example because a shadow on the wall resembles a differentfeature of the other image in the stereo pair) then this can beidentified and corrected using disparity values from one or moreprevious maps.

Similarly optionally, inconsistencies in disparity may be isolated byusing different block sizes (e.g. windows for autocorrelation detection)to derive disparity maps and identifying inconsistencies between theseversions of the map to produce a map with higher confidence disparityvalues.

Similarly optionally, an edge detection algorithm can be used tocross-validate where disparity values should be expected to change inthe images.

Similarly optionally, a point-by-point disparity check can beimplemented, for example by using a 3×3 pixel test window on thedisparity map, and calculating whether the central pixel disparity isdifferent by more than a predetermined amount; and if so, that pixeldisparity is replace, for example with the average of the disparity ofthe other eight pixels in the test window (or some other local disparityvalue).

Other optional refinements to the process of making the initial meshrelate to the selection of (x,y) points in the image to use fortriangulation.

To provide a sampling of points of reasonable density in the image,optionally at least one point is sampled in each P×Q block of pixels,where P and Q are predetermined dimensions (for example, an 8×8 block ofpixels), and is stored with an associated disparity value. The point maybe selected from either image of the stereo pair or alternatively from aprocessed version of one image (or from both if combined).Optionally,more points are sampled within a block where there is an apparent edgein either colour or disparity values, in order to make the resultingmesh more faithfully track the structural elements of the scene likelyto correspond with such colour and/or disparity edges. The edge itselfmay be determined first to satisfy a consistency criterion, for examplehaving a predetermined minimum length, and/or gradient of change incolour or disparity.

Thus optional filters have been provided to remove inconsistencies inthe disparity map, and to select salient (x,y) points for triangulation(for example Delaunay triangulation) to create a 2D mesh with associateddisparity or depth values.

This 2D mesh can then be easily projected into 3D by giving the verticesof the 2D mesh the depth values associated with the points.

It will be appreciated that in principle the (x,y) points and z valuescan be used to generate a 3D mesh in one step. However, by optionallyhaving a 2D mesh and exactly corresponding 3D mesh, it is simple tocross reference the 3D mesh with the 2D mesh to calculate the distancebetween pixels in the image space that the 3D model will replicate.

As will be noted below, polygons comprising small differences in (x,y)distances but proportionately large differences in z distance areindicative of meshing errors and can be removed, as explained laterherein.

Hence returning now to FIG. 1 and now also FIG. 2, then using the lineA-A in FIG. 1 as an example, then FIG. 2 illustrates a plan view of aslice through a mesh at a corresponding line in the digital model. FIG.2 is shown aligned with one of the images from FIG. 1 for ease ofunderstanding. It can be seen that the depth of the mesh on the leftside is effectively infinite (or at a maximum depth), corresponding tothe doorway out of the room. The mesh then generally maps along thewall. However, there is a clear error where the images show the child.As noted above, the problem is that a simple triangulation of the pointsin the disparity map can create a mesh that incorrectly treats isolatednear-field objects as solid projections from the background. Hence inFIG. 2, the (x,y,z) points corresponding to the child's head areinterpreted as a projection forwards from the adjacent (x,y,z) pointscorresponding to the wall of the room. This is clearly wrong.

To address this, in an embodiment of the present invention, thegeneration of such a mesh is performed in a plurality of N stages orlayers. These layers are defined as follows.

The minimum disparity in the image, corresponding to the furthestdistance, is denoted dispMin.

The maximum disparity (or the maximum valid disparity, if a cut-off isbeing applied) is denoted dispMax.Then, dispPerLayer=(dispMax−DispMin)/N.dispPerLayer defines a disparity range for successive analysis layers ofthe disparity map. Hence a first layer encompases a start point dispMinto an end point (dispMin+dispPerLayer)−1, and a second layer encompassesa start point (dispMin+dispPerLayer) to an end point(dispMin+(2×dispPerLayer)−1), and so on. In this embodiment, the layerssimply adjoin and do not overlap, or only overlap in the sense ofstarting or terminating at the same depth as the adjacent layer. Bothinterpretations are treated as ‘non-overlapping’ herein.

It will be appreciated that since there is typically a non-linearrelationship between disparity and physical distance, then similarly thecalculated distance may be divided equally by N, and the correspondingdisparity ranges identified for each of the resulting N layers.

In either case however, it will be understood that each successive layerrepresents a slice of the disparity map in the z-axis having thicknessdispPerLayer, progressing from the most distant elements in the mapforwards.

Referring now to FIGS. 3A to 3C, these illustrate a mesh generationprocess with (as a non-limiting example) 4 such layers, labelled 0 to 3in FIG. 3A.

Starting with layer 0, only the disparity or depth values within therange of this layer are considered. For processing efficiency, this maybe achieved by copying only the points of the disparity map within thisrange to a temporary disparity map, which is then subject to a 2D/3Dmeshing process such as the Delaunay triangulation process referred toabove. In this case the remaining points in the temporary disparity mapare treated as invalid or empty points as appropriate. It will beappreciated that any of the optional filtering processes previouslydescribed can be applied to the points of the image as a whole, or on alayer-by-layer basis, as appropriate.

Hence in layer 0, only the depth information corresponding to thedoorway in the scene of FIG. 1 is present. A mesh based on these actual(x,y,z) points (shown with a solid line in FIG. 3B) is created for layer0.

Next, for layer 1, a mesh based on the actual (x,y,z) points is shownwith a solid line in FIG. 3B. Notably, due to the layering processdescribed above, the mesh for this layer is generated as if the childwas not in the room at all. Consequently the region of (x,y,z) pointsmissing due to their occlusion by the child in the captured stereo imageare interpolated in a manner consistent with the actual (x,y,z) pointsin this layer, and may be treated automatically by a Delaunay algorithmas a region of the point cloud with sparse samples. The interpolatedsection of the mesh is shown in FIG. 3B with dotted lines.

In this example layer 2 does not encompass any disparity values.

For layer 3, again a mesh based on the actual (x,y,z) points in thislayer is generated. In this case, these correspond to the foregroundobject, which is the child.

The resulting meshes are then merged to form a single composite digitalmodel of the scene.

Several optional rules may be implemented at this point to provide agood overall result, including one or more selected from the listconsisting of:

Firstly, where the meshes of two layers terminate but have terminal x, yand z positions within a threshold distance of each other, then thesemeshes may be joined. Optionally for layers 0 and 1 the restriction onthe z position may be relaxed, since layer 0 may reach to infinity.Hence for example the mesh of layer 0 may still be joined to the mesh oflayer 1, as shown by the dotted line in FIG. 3C, because they haveadjoining x, y values.

Secondly, where two meshes overlap, duplicate polygons at the samepositions (or within a predetermined tolerance) are deleted.

Thirdly, as noted above, where a polygon in a mesh covers a smalldistance in the x,y plane, but a large distance along the z axis (asdefined by predetermined absolute or relative thresholds) then thatpolygon may be deleted. Put another way, polygons in a layer mesh havinga predetermined angle close to the normal to the image plane, orsimilarly, close to parallel to the line of sight of the camera, may beremoved.

Fourthly, where the meshes of two layers occupy similar x, y positionsbut not similar z positions as defined by a predetermined threshold,then it can be assumed that the meshes represent discrete objects, as inthe child of layer 3 and the wall of layer 1 in the present example. Inthis case, the foreground mesh may optionally be closed (represented bythe dotted line on the mesh corresponding to the child in FIG. 3C).

In a similar manner to the optional point selection describedpreviously, optionally other discriminators may be used to improveforeground and background segmentation of this kind, including but notlimited to colour segmentation. For example, if a first colour isassociated with the background polygons, but not with foregroundpolygons (and/or vice versa), then for (x,y) positions close to the edgeof the foreground object, the associated colours can be used to refinethe meshes to more closely segregate the foreground object.

Finally, during creation of the mesh at each layer, optionally a rulemay be implemented to suppress interpolation of the mesh for points morethan a predetermined distance apart, where the distance is a function ofthe layer number. Optionally this rule may only be enacted after apredetermined proportion of layers have been meshed, such as 50% or 75%.The purpose of this rule is to prevent or reduce erroneous interpolationof a mesh between two people standing in the same foreground layer.

It will be appreciated that typically the object(s) causing the mostrelevant occlusions will be the one or more people interacting with theconsole. Consequently for example the console may use face recognitionto identify a plurality of users in the images and their correspondingdepth positions in the disparity map, and select N or modify the layerranges to ensure that they are meshed in a separate layer from thebackground and preferably also from each other. More generally, theconsole may select a value of N responsive to the maximum distance orminimum disparity value so that each layer is of a thickness (or has apoint population) sufficient to build a reasonable mesh. In general, thehigher the value of N (i.e. the more layers used), the better the endresult.

Where two people are in the same layer, recognition that they are peoplecan also be used to constrain mesh generation, treating them as aspecial case and possibly using different mesh generation rules basedupon for example skeletal modelling. Interpolation between identifiedpeople can also therefore be suppressed in this way.

It will be appreciated that the layers in the embodiment described aboveare non-overlapping. However, referring now to FIGS. 4A to 4C, in analternative embodiment the layers are defined as follows; the firstlayer 0′ encompases start point dispMin to end point(dispMin+dispPerLayer), the second layer 1′ encompasses start pointdispMin to end point (dispMin+(2×dispPerLayer)), and the third layer 2′encompasses start point dispMin to end point (dispMin+(3×dispPerLayer)),and so on. That is to say, the layers overlap, and starting at thefurthest distance they get progressively deeper to encompass more of thedisparity map each time. In the example above where N=4, then the finallayer 3′ encompassing start point dispMin to end point(dispMin+(4×dispPerLayer)) includes all the points in the disparity map,like the conventional mesh described previously and illustrated in FIG.2. The individual meshes can follow similar rules to those described inthe previous embodiment, such as suppressing interpolation for highdisparity points, refining meshes using colour information, and/orlimiting interpolation (or using different meshing techniques) foridentified people in the images. They can also use the above describedoptional filters and foreground separations strategies.

FIG. 4A illustrates the mesh generated for layer 1′. FIG. 4B illustratesthe mesh generated for layer 3′.

As in the previous embodiment, the meshes are merged successively. Hencethe mesh of layer 1′ is merged with the mesh of layer 0′ to generate afirst merged mesh. Then the mesh of layer 2′ is merged with the firstmerged mesh to generate a second merged mesh. Then the mesh of layer 3′is merged with the second merged mesh to generate a third merged mesh.This process can be implemented as new layer meshes are generated, oronce all layer meshes have been generated.

Again, during the merging process duplicate polygons from differentmeshes that substantially overlap are deleted, preferably preserving thepolygon generated in the mesh of the thinner (earlier) layer. Again,where a polygon in a mesh covers a small distance in the x,y plane, buta large distance on the z-axis (as defined by predetermined thresholds)then that polygon is deleted, in other words where the polygon is,within a predetermined tolerance, on the z-plane, or parallel to theline of sight of the cameras, or substantially normal to the imageplane, then it is deleted. This latter step for example effectivelyremoves the connection between foreground objects and background objectsin the meshes of the thicker layers.

FIG. 4C illustrates the merged meshes in the present example. Here, theleft-most section of the mesh corresponds to the mesh generated forlayer 0′, which was overlapped by each successive mesh and so theduplicate polygons were deleted. The section of the mesh correspondingto the wall was generated for layer 1′, with the interpolated section ofthe mesh for the wall shown as a dotted line. The duplicate polygons forthe wall also generated for layers 2′ and 3′ would have been deleted.Finally, the mesh for the child was generated for layer 3′. It will beappreciated that, as noted previously, the mesh for the child does notoverlap that of the wall; whilst it has similar x,y co-ordinates to asection of the wall, it has different z co-ordinates and hence does notoverlap in 3 dimensions. Meanwhile the polygons that were nearly normalto the image plane (having a small x-y distance and a large z distance)have been deleted, separating the child from the wall. As in theprevious embodiment, optionally the mesh corresponding to the child hasbeen closed, denoted by the dotted line on the part of the meshcorresponding to the child.

Hence the present invention may operate using a series of eitheroverlapping or non-overlapping layers, successively moving forward alongthe z axis. The overall resulting 3D model is similar using eitherembodiment. For non-overlapping layers, logic relating to linking meshesfor surfaces that pass through the layer interfaces may have moresignificance, whilst for overlapping layers, logic relating toidentifying and deleting duplicate polygons may have more significance.

For the meshes from either embodiment, finally an optional mesh filtermay be employed as follows. In a first step the entertainment devicecompares neighbouring polygons to determine if they are substantially onthe same plane. For example if 3 polygons sharing a vertex point liewithin a predetermined angle of each other (for example ±1, 2, 4 or 6degrees, depending on designer choice) then these polygons can bemodified to lie on a plane derived from the average of each of thepolygon's individual planes. Optionally several passes through the meshmay be performed in this manner to homogenise the planar orientation ofpolygons that are initially only roughly co-planar.

The purpose of this filtration is to make the surface smoother and alsoto make the local normals on the surface more consistent and closer tothat expected by the user, so that light and/or virtual objects can bemade to bounce off that surface in a more realistic and expected manner.

Alternatively or in addition, patch based plane detection (or RANSAC oranother plane detection algorithm) is applied to a relatively large setof vertices (for example, vertices corresponding to a region of colourin the corresponding image) and calculates the overall plane. Thesevertices are then updated to lie on the plane, thereby removing anybumps in the majority of that surface.

Turning now to FIGS. 5A and 5B, in addition to the generation of themesh for the digital model of the scene, in embodiments of the presentinvention it is also desirable to generate textures to apply to themesh.

It will be appreciated that for regions of the mesh corresponding tovisible elements of one or both of the stereo images, the texture can bederived from one or both images. However, it is also desirable togenerate textures for those parts of the mesh occluded from view in theoriginal images, so that these parts of the model are visible if theviewpoint is modified by the user.

Referring to FIG. 5A, by way of example, the circled points in thefigure show different sections of a carpet or rug. In a colour renditionof the image, the point 1001L is a salmon pink, whilst 1001R is a beigeand green mix. However, the interface between these two sections of therug is obscured by the child in both images.

Consequently, texture interpolation between two points 1001L and 1001Rmay be optionally performed for the corresponding section of the meshmodel as follows.

In FIG. 5B, the two pixel positions 1001L and 1001R have colour valueslabelled ‘A’ and ‘1’ respectively, denoting the arbitrary colour valuesat those positions in the current images. In the texture to be appliedto the mesh, three intervening pixels 1002, 1003, 1004 are undefined.

To interpolate the colour values of these pixels, in an embodiment ofthe present invention the colour values ‘A’ and ‘1’ corresponding topositions 1001L and 1001R are not used.

Instead, colour values of neighbouring pixels positioned away from theundefined pixels are used.

This is because in the image, the missing pixels are obscured by anunrelated foreground object (the child) and for the pixels immediatelyadjacent to this object in the images there is a significant risk thatthe pixel colour at positions 1001L and 1001R is in fact already acombination of the colour of the foreground and background objects, dueto the per-pixel colour sampling in the CCDs of the video camera source.Rather than propagate this tainted colour across the undefined pixels,it is assumed that neighbouring pixels further from the foregroundobject may be more representative of the true background colour.

Hence in an embodiment of the present invention, the three interpolatedpixels may therefore take the following values:

-   -   1002—75% ‘B’, 25% ‘2’    -   1003—50% ‘B’, 50% ‘2’    -   1004—25% ‘B’, 75% ‘2’.

This provides a uniform transition between the colours ‘B’ and ‘2’sampled one pixel adjacent to positions 1001L and R.

Alternatively, successively distant neighbouring pixels may be used. Thepurpose of this is to preserve the existing variability of the textureas well as to blend the colours. In a transient image, this will makethe interpolation less obvious as the spatial frequencies in theinterpolated section will now be similar to those in the surroundingtexture.

Hence in this embodiment, the three interpolated pixels may take thefollowing values:

-   -   1002—75% ‘B’, 25% ‘4’    -   1003—50% ‘C’, 50% ‘3’    -   1004—25% ‘D’, 75% ‘2’.

The polygon mesh and the texture(s) may then be rendered and displayedon screen. For the same viewpoint as the original camera, the resultingrender is likely to look nearly identical to the original image, as onlymesh based on actual (x,y,z) points and texture from visible image datawill be used. However, as the virtual viewpoint is moved, for example aspart of a game play mechanic, or in response to head tracking of aviewer, then elements of the scene that have been interpolated becomevisible.

Thus more generally, such texture gaps are filled in with local texturedata on a scan-line basis, with the texture on either side of the gapbeing mirrored into the gap.

Optionally where the still image or video was taken using a cameraequipped with a suitable accelerometer or set of accelerometers, thenthe angle of the photo with respect to horizontal can be obtained, andthis can be used to adjust the effective scan line used in the gapfilling process. Hence for example if the gap to be filled was 50 pixelslong, and accelerometer data suggested that the camera was at an angleof 3 degrees to the horizontal, then the gap filling algorithm mayapproximate a scan line spanning approximately 50×Sin (3) lines ofpixels in the captured image. If no accelerometer data exists, thenoptionally an effective scanline may be chosen to run parallel to anearby edge in the image that is close to horizontal.

In an embodiment of the present invention, the mesh and textures (i.e.the 3D model) generated as described above or by another suitable methodis persistent, and retained from frame to frame of the captured video.

In this 3D model, background objects can be measured or assumed to bestationary; for example an object that (for its distance) is a thresholdamount P larger than a person where P is a predetermined proportion such1.5 or 2, and/or which has a flat surface, and/or does not move over Qsuccessive video frames, where Q is a predetermined number such as 30 or90, can be assumed to be part of the background and assumed to bestationary.

It will be appreciated that if a background object is partially occludedby a person, then when that person moves, the portion of the backgroundobject that is revealed can be added to the model, both in terms ofconfirmed mesh geometry and confirmed texture.

Confirmed mesh and texture values can then be used to improve theinterpolation of the model behind where the user is currently stood asthey move around.

Where foreground objects are static (for example a desk) and obscure abackground object (for example a wall or carpet) then the model canextrapolate the wall/floor surfaces and associated textures.

Notably, whilst (assuming a fixed camera position) these extrapolatedsurfaces may never be seen directly they can affect the result ofplacing a virtual light source in the model, or may be used to constrainor interact with virtual objects such as pets, or bouncing balls.

Referring to FIG. 6, for example, the chair in the room permanentlyobscures parts of the wall, the doorway, the floor and the rug. Themeshes defining these surfaces behind the chair can be extrapolateduntil they meet, and the colour components of the surfaces can besimilarly extrapolated, either with uniform colours (1012, 1014) orusing colour combinations or repeated textures (1016), for example in asimilar manner to that described with reference to FIG. 5B. In thiscase, the wall is blue, the floor is a khaki colour and the rug is a mixof beige and terracotta.

It will be appreciated therefore that if a virtual white light sourcewas positioned in the 3D model between the chair and the wall, whilstthe light source itself would be obscured by the chair, the reflectedlight would (in this example) have a blue/green tint. This light wouldaffect the colour of the other objects in the 3D model if the model wasrendered.

The model of the chair may also cast a shadow from the virtual lightthat plays over part of the model of the user.

Consequently, the model of the scene can be realistically lit usingvirtual light sources.

In a similar way, a ball whose trajectory took it behind the chair wouldbounce off the unseen floor and/or wall in a realistic manner andre-emerge in a direction intuitively expected by the user. One or morephysical properties associated with the ball (its shape, mass,resilience and/or damping, for example) can be used to calculate how theball interacts with the model of the room.

In an embodiment of the present invention, the rendered model isdisplayed instead of augmenting the original stereo video or stereophoto. This is particularly the case when the user changes the desiredviewpoint of the image from that of the original image.

However, in an embodiment of the present invention, the original stereovideo or stereo photo is augmented using the rendered model as follows.When an augmentation of the original image comprises the addition of avirtual light source, this light source is added or applied to the 3Dmodel as described above. The model is then rendered (but not displayed)with this light source at the same viewpoint as the video camera, tocalculate how the light source and its reflections, shadows etc. modifythe rendered textures. These modifications to the rendered textures(i.e. the colour difference with and without the light source) therebygenerate a red/green/blue colour change map of the effect of the virtuallight source on the scene.

These red/green/blue colour changes can then be applied to the originalcaptured video. In this way, the effects of the virtual light on thevirtual model of the scene can be applied to the real video of the scenefor the corresponding video frame, thus seeming to apply a virtual lightsource to the original video. For 3D video, the rendering, colour changemapping and augmentation can be done for each of the left and rightviewpoints.

It will be appreciated therefore that as appropriate the above describedtechniques enable a variety of applications.

In an embodiment of the present invention, a virtual light source (or avirtual object comprising a lightsource) may be made to apparently movewithin a stereoscopic photo or video, and cast plausible shadows ofobjects in the scene onto other objects. The colour of the light sourcecan be seen to affect the scene, and colours in the scene may affect howreflected light affects other elements of the scene.

This may be implemented on a render of the model of the scene, or theeffects of the virtual light on the model may be transposed to theoriginal photo or video frame to augment it.

Alternatively or in addition, virtual objects can interact with themodel of the scene. This may take the form of the model acting as abounding box for virtual objects and characters, and/or the surfaces ofthe model providing surfaces for physics/based interactions, such asbounding a ball against a wall, or dropping a ball onto a table andhaving it bounce off and onto the floor. Where an element of the sceneis mobile (i.e. the user) then motion data can be accumulated and usedin such physics based interactions, for example giving or adding a newvelocity to a ball (i.e. hitting it in a new direction) as noted above,these interactions can utilise at least one physical property associatedwith the virtual object, such as its shape, mass, bounciness and soforth.

Again, such interactions may be implemented on a render of the model ofthe scene, or the virtual objects, as computed to interact with themodel of the scene, may be rendered appropriately and then used toaugment the original photo or video frame.

Alternatively or in addition, head tracking of a user may be employed todetect their current viewpoint with respect to the displayed image. Ifthis viewpoint is different to that of the camera that caught the image(or differs by a threshold amount), then the rendered model of the imageis displayed from the user's detected viewpoint. The subjective effectis therefore that the user can move their head left, right, up or downand apparently see the picture be recomposed as if it were a real 3Dspace on the other side of the display screen.

Finally, it will be appreciated that whilst the above description refersto live video capture, the techniques described herein are alsoapplicable to pre-recorded stereoscopic images and video.

A suitable device for carrying out the above techniques and variantsunder suitable software instruction include but are not limited to theSony® PlayStation 3® and PS Vita®. Hence for example other devices mayinclude set-top television boxes for terrestrial, satellite and/or cablebroadcast TV, set-top boxes for IPTV, PCs and other media consumptiondevices with suitable processing power, and Blu-Ray® players.

By way of example, FIG. 7 schematically illustrates the overall systemarchitecture of the Sony® Playstation 3® entertainment device. A systemunit 10 is provided, with various peripheral devices connectable to thesystem unit.

The system unit 10 comprises: a Cell processor 100; a Rambus® dynamicrandom access memory (XDRAM) unit 500; a Reality Synthesiser graphicsunit 200 with a dedicated video random access memory (VRAM) unit 250;and an I/O bridge 700.

The system unit 10 also comprises a Blu Ray® Disk BD-ROM® optical diskreader 430 for reading from a disk 440 and a removable slot-in hard diskdrive (HDD) 400, accessible through the I/O bridge 700. Optionally thesystem unit also comprises a memory card reader 450 for reading compactflash memory cards, Memory Stick® memory cards and the like, which issimilarly accessible through the I/O bridge 700.

The I/O bridge 700 also connects to four Universal Serial Bus (USB) 2.0ports 710; a gigabit Ethernet port 720; an IEEE 802.11b/g wirelessnetwork (Wi-Fi) port 730; and a Bluetooth® wireless link port 740capable of supporting up to seven Bluetooth connections.

In operation the I/O bridge 700 handles all wireless, USB and Ethernetdata, including data from one or more game controllers 751. For examplewhen a user is playing a game, the I/O bridge 700 receives data from thegame controller 751 via a Bluetooth link and directs it to the Cellprocessor 100, which updates the current state of the game accordingly.

The wireless, USB and Ethernet ports also provide connectivity for otherperipheral devices in addition to game controllers 751, such as: aremote control 752; a keyboard 753; a mouse 754; a portableentertainment device 755 such as a Sony Playstation Portable®entertainment device; a video camera such as a stereoscopic version ofthe PlayStation Eye® video camera 756; and a microphone headset 757.Such peripheral devices may therefore in principle be connected to thesystem unit 10 wirelessly; for example the portable entertainment device755 may communicate via a Wi-Fi ad-hoc connection, whilst the microphoneheadset 757 may communicate via a Bluetooth link.

The provision of these interfaces means that the Playstation 3 device isalso potentially compatible with other peripheral devices such asdigital video recorders (DVRs), set-top boxes, digital cameras, portablemedia players, Voice over IP telephones, mobile telephones, printers andscanners.

In addition, a legacy memory card reader 410 may be connected to thesystem unit via a USB port 710, enabling the reading of memory cards 420of the kind used by the Playstation® or Playstation 2® devices.

The game controller 751 is operable to communicate wirelessly with thesystem unit 10 via the Bluetooth link. However, the game controller 751can instead be connected to a USB port, thereby also providing power bywhich to charge the battery of the game controller 751. In addition toone or more analog joysticks and conventional control buttons, the gamecontroller is sensitive to motion in 6 degrees of freedom, correspondingto translation and rotation in each axis. Consequently gestures andmovements by the user of the game controller may be translated as inputsto a game in addition to or instead of conventional button or joystickcommands. Optionally, other wirelessly enabled peripheral devices suchas the portable entertainment device 755 or the Playstation Move (RTM)758 may be used as a controller. In the case of the portableentertainment device, additional game or control information (forexample, control instructions or number of lives) may be provided on thescreen of the device. In the case of the Playstation Move, controlinformation may be provided both by internal motion sensors and by videomonitoring of the light on the Playstation Move device. Otheralternative or supplementary control devices may also be used, such as adance mat (not shown), a light gun (not shown), a steering wheel andpedals (not shown) or bespoke controllers, such as a single or severallarge buttons for a rapid-response quiz game (also not shown).

The remote control 752 is also operable to communicate wirelessly withthe system unit 10 via a Bluetooth link. The remote control 752comprises controls suitable for the operation of the Blu Ray Disk BD-ROMreader 430 and for the navigation of disk content.

The Blu Ray Disk BD-ROM reader 430 is operable to read CD-ROMscompatible with the Playstation and PlayStation 2 devices, in additionto conventional pre-recorded and recordable CDs, and so-called SuperAudio CDs. The reader 430 is also operable to read DVD-ROMs compatiblewith the Playstation 2 and PlayStation 3 devices, in addition toconventional pre-recorded and recordable DVDs. The reader 430 is furtheroperable to read BD-ROMs compatible with the Playstation 3 device, aswell as conventional pre-recorded and recordable Blu-Ray Disks.

The system unit 10 is operable to supply audio and video, eithergenerated or decoded by the Playstation 3 device via the RealitySynthesiser graphics unit 200, through audio and video connectors to adisplay and sound output device 300 such as a monitor or television sethaving a display 305 and one or more loudspeakers 310. The audioconnectors 210 may include conventional analogue and digital outputswhilst the video connectors 220 may variously include component video,S-video, composite video and one or more High Definition MultimediaInterface (HDMI) outputs. Consequently, video output may be in formatssuch as PAL or NTSC, or in 720p, 1080i or 1080p high definition.

Audio processing (generation, decoding and so on) is performed by theCell processor 100. The Playstation 3 device's operating system supportsDolby® 5.1 surround sound, Dolby® Theatre Surround (DTS), and thedecoding of 7.1 surround sound from Blu-Ray® disks.

In the present embodiment, the stereoscopic video camera 756 comprises apair of charge coupled devices (CCDs) with respective optics, an LEDindicator, and hardware-based real-time data compression and encodingapparatus so that compressed video data may be transmitted in anappropriate format such as an intra-image based MPEG (motion pictureexpert group) standard for decoding by the system unit 10. The cameraLED indicator is arranged to illuminate in response to appropriatecontrol data from the system unit 10, for example to signify adverselighting conditions. Embodiments of the stereoscopic video camera 756may variously connect to the system unit 10 via a USB, Bluetooth orWi-Fi communication port. Embodiments of the video camera may includeone or more associated microphones and are also capable of transmittingaudio data. In embodiments of the video camera, the CCDs may have aresolution suitable for high-definition video capture. In use, imagescaptured by the video camera may for example be incorporated within agame or interpreted as game control inputs.

In general, in order for successful data communication to occur with aperipheral device such as a stereoscopic video camera or remote controlvia one of the communication ports of the system unit 10, an appropriatepiece of software such as a device driver should be provided. Devicedriver technology is well-known and will not be described in detailhere, except to say that the skilled man will be aware that a devicedriver or similar software interface may be required in the presentembodiment described.

In an embodiment of the present invention, the camera 756 is notnecessarily used to capture the stereo image (or may have captured itpreviously) and hence may not itself be a stereoscopic camera, or notcurrently operating in a stereoscopic mode (as applicable), but is usedto obtain an image of the user(s) for head tracking. As notedpreviously, head tracking may be used to generate a respective viewpointof the 3D model so that a user can look around within the scene. Wheretwo or more users are viewing the scene, then optionally two or moreviews may be rendered for respective display to each user (for exampleusing active shutter glasses).

Referring now to FIG. 8, in a summary embodiment of the presentinvention, a method of augmenting a first stereoscopic image comprisinga pair of images comprises in a first step s10, generating a disparitymap from the pair of images of the first stereoscopic image, thedisparity map being indicative of distances in the first stereoscopicimage; in a second step s20, generating a virtual three-dimensionalmodel comprising a mesh based upon the distances indicated by thedisparity map, thereby creating an approximate 3D model of the scenecaptured in the first stereoscopic image; in a third step s30, modellingan interaction of a virtual object with that three dimensional model, inwhich the virtual object has a physical attribute associated with it,and the interaction of the virtual object with the three dimensionalmodel utilises the physical attribute; and in a fourth step s40,outputting for display an image corresponding to the first stereoscopicimage that comprises a visible effect of the interaction of the virtualobject with the three dimensional model.

In an instance of the summary embodiment, the step of generating athree-dimensional model in turn comprises a sub-step of defining aseries of value ranges corresponding to disparity values of thedisparity map, each value range in the series having an end pointcorresponding to a greater disparity than an end point of precedingvalue ranges in the series; a sub-step of selecting points in thedisparity map falling within the respective value range; a sub-step ofgenerating a respective mesh responsive to those selected points; and asub-step of merging the resulting series of generated meshes to form the3D model of the scene.

In an instance of the summary embodiment, the virtual object has one ormore physical attributes associated with it, and the interaction of thevirtual object with the three dimensional model is responsive to the oreach physical attribute.

Consequently, if the displayed image is an augmented version of at leastone of the pair of images of the first stereoscopic image the method maycomprise the step of augmenting the or each image of the firststereoscopic image with the virtual object at a position responsive toits interaction with the three dimensional model.

In an instance of the summary embodiment, the method further comprises astep of generating at least a first texture from one or both of the pairof images of the stereoscopic image; a step of applying the texture toat least a respective part of the three dimensional model; and a step ofrendering (at least in an internal memory, and not necessarily fordisplay) the textured three dimensional model together with the virtualobject.

Consequently, if the virtual object has one or more physical attributesassociated with it, and the interaction of the virtual object with thethree dimensional model is responsive to the or each physical attribute,then the displayed image may comprise the rendered textured threedimensional model with the virtual object at a position responsive toits interaction with the three dimensional model.

Similarly consequently, the virtual object may comprise a light source,and the rendered textured three dimensional model may be illuminatedresponsive to that light source.

In this case, optionally if the displayed image is an augmented versionof at least one of the pair of images of the first stereoscopic image,the method may comprise a step of calculating a difference mapindicating the differences in rendered pixel values between renderingthe textured three dimensional model with and without the light sourceof the virtual object; and a step of applying that difference map to theat least one of the pair of images of the first stereoscopic image togenerate the displayed image.

Similarly in this case, if the displayed image comprises the renderedtextured three dimensional model, this may be illuminated responsive tothe light source of the virtual object.

Again dependent upon the generating and applying a texture to the model,the rendering of the textured three dimensional model with the virtualobject may be performed for one or more viewpoints other than those ofthe pair of images of the first stereoscopic image, so as to generate anew view of the scene depicted in the first stereoscopic image.

In this case, the selection of the viewpoint(s) may be based upon a stepof tracking the position of a user's head with respect to a display; anda step of calculating the or each viewpoint for rendering, responsive tothe deviation of the user's head from a default viewpoint (i.e. theviewpoint of the original stereo image). The effect of this tracking andrendering process is that as the user moves their head, the image isrecomposed for the new viewpoints (including where necessary filling inoccluded pixels as described previously), so that it looks as thoughthere is a ‘real’ 3D space behind the display screen that can be lookedaround.

It will be appreciated that in this case it is not necessary to includethe steps of modelling an interaction of a virtual object with the threedimensional model or displaying a visible effect of such an interaction,if only the ability to look at different viewpoints is desired.

Meanwhile, in a summary embodiment of the present invention, anentertainment device 10 (such as the Sony PS3 or PS Vita) for augmentinga first stereoscopic image (for example an image captured from astereoscopic camera 756 in communication with the entertainment device,or from a still or video file stored on the hard disk 400 or BD Rom 440)comprising a pair of images, itself comprises input means (such as WiFi730, Bluetooth 740, and USB 710) operable to receive the firststereoscopic image data; disparity processing means (such as the Cellprocessor 100 and/or RSX 200) operable to generate a disparity map fromthe pair of images of the first stereoscopic image, the disparity mapbeing indicative of distances in the first stereoscopic image; virtualmodelling means (such as the Cell processor 100 and/or RSX 200) operableto generate a virtual three-dimensional model responsive to thedistances indicated by the disparity map; interaction modelling means(such as the Cell processor 100 and/or RSX 200) operable to model aninteraction of a virtual object with that three dimensional model; andoutput means (such as the RSX 200) operable to output for display animage corresponding to the first stereoscopic image that comprises avisible effect of the interaction of the virtual object with the threedimensional model.

In an instance of the summary embodiment, the entertainment device alsocomprises texture generation means (such as the Cell processor 100and/or RSX 200) operable to generate at least a first texture from oneor both of the pair of images of the stereoscopic image; texturing means(such as the RSX 200) operable to apply the texture to at least arespective part of the three dimensional model; and rendering means(such as the RSX 200) operable to render the textured three dimensionalmodel together with the virtual object.

It will be appreciated that the methods disclosed herein may be carriedout on conventional hardware suitably adapted as applicable by softwareinstruction or by the inclusion or substitution of dedicated hardware,such as the Sony PS Vita® or the PS3® described above.

Thus the required adaptation to existing parts of a conventionalequivalent device may be implemented in the form of a non-transitorycomputer program product or similar object of manufacture comprisingprocessor implementable instructions stored on a data carrier such as afloppy disk, optical disk, hard disk, PROM, RAM, flash memory or anycombination of these or other storage media, or realised in hardware asan ASIC (application specific integrated circuit) or an FPGA (fieldprogrammable gate array) or other configurable circuit suitable to usein adapting the conventional equivalent device. Separately, ifapplicable the computer program may take the form of a transmission viadata signals on a network such as an Ethernet, a wireless network, theInternet, or any combination of these or other networks.

The foregoing discussion discloses and describes merely exemplaryembodiments of the present invention. As will be understood by thoseskilled in the art, the present invention may be embodied in otherspecific forms without departing from the spirit or essentialcharacteristics thereof. Accordingly, the disclosure of the presentinvention is intended to be illustrative, but not limiting of the scopeof the invention, as well as other claims. The disclosure, including anyreadily discernible variants of the teachings herein, defines, in part,the scope of the foregoing claim terminology such that no inventivesubject matter is dedicated to the public.

The invention claimed is:
 1. A method of augmenting a first stereoscopicimage comprising a pair of images, the method comprising the steps of:generating, by one or more processors, a disparity map from the pair ofimages of the first stereoscopic image, the disparity map beingindicative of distances in the first stereoscopic image; generating avirtual three-dimensional model comprising a mesh based upon thedistances indicated by the disparity map; modelling, by the one or moreprocessors, an interaction of a virtual object with the threedimensional model, in which the virtual object has a physical attributeassociated with it, and the interaction of the virtual object with thethree dimensional model utilises the physical attribute; and outputting,for display, an image corresponding to the first stereoscopic image thatcomprises a visible effect of the interaction of the virtual object withthe three dimensional model; in which the step of generating the virtualthree-dimensional model comprises in turn the steps of: defining aseries of value ranges corresponding to disparity values of thedisparity map, each value range in the series having an end pointcorresponding to a greater disparity than an end point of precedingvalue ranges in the series; selecting points in the disparity mapfalling within the respective value range; generating a respective meshresponsive to those selected points; and merging the resulting series ofgenerated meshes to form the 3D model of the scene; wherein: eachrespective mesh is within a depth range; and merging the resultingseries of generated meshes to form the 3D model of the scene is doneacross a depth spanned by the depth ranges of the respective mesheswherein the merged 3D model of the scene is made up of a continuousgeometry.
 2. A method according to claim 1, in which the image fordisplay is an augmented version of at least one of the pair of images ofthe first stereoscopic image, and the method comprises the step of:augmenting one or both of the pair of images of the first stereoscopicimage with the virtual object at a position responsive to itsinteraction with the three dimensional model.
 3. A method according toclaim 1, comprising the steps of: generating at least a first texturefrom one or both of the pair of images of the stereoscopic image;applying the first texture to at least a respective part of the threedimensional model to obtain a textured three dimensional model; andrendering the textured three dimensional model together with the virtualobject.
 4. A method according to claim 3, in which: the virtual objecthas one or more physical attributes associated with it, and theinteraction of the virtual object with the three dimensional model isresponsive to the or each physical attribute; and in which the image fordisplay comprises the rendered textured three dimensional model with thevirtual object at a position responsive to its interaction with thethree dimensional model.
 5. A method according to claim 3, in which thevirtual object comprises a light source, and the rendered textured threedimensional model is illuminated responsive to that light source.
 6. Amethod according to claim 5, in which the image for display is anaugmented version of at least one of the pair of images of the firststereoscopic image, and the method comprises the steps of: calculating adifference map indicating differences in rendered pixel values betweenrendering the textured three dimensional model with and without thelight source of the virtual object; and applying that difference map tothe at least one of the pair of images of the first stereoscopic imageto generate the displayed image.
 7. A method according to claim 5, inwhich the image for display comprises the rendered textured threedimensional model illuminated responsive to the light source of thevirtual object.
 8. A method according to claim 3, in which the renderingof the textured three dimensional model with the virtual object isperformed for one or more viewpoints other than those of the pair ofimages of the first stereoscopic image, so as to generate a new view ofthe scene depicted in the first stereoscopic image.
 9. A methodaccording to claim 8, comprising the steps of: tracking a position of auser's head with respect to a display; and calculating at least one ofthe one or more viewpoints for rendering responsive to a deviation ofthe user's head from a default viewpoint.
 10. A non-transitory computerprogram product comprising computer readable instructions that whenimplemented by a computer cause it to perform a method comprising thesteps of: generating a disparity map from the pair of images of thefirst stereoscopic image, the disparity map being indicative ofdistances in the first stereoscopic image; generating a virtualthree-dimensional model comprising a mesh based upon the distancesindicated by the disparity map; modelling an interaction of a virtualobject with the three dimensional model, in which the virtual object hasa physical attribute associated with it, and the interaction of thevirtual object with the three dimensional model utilises the physicalattribute; and outputting, for display, an image corresponding to thefirst stereoscopic image that comprises a visible effect of theinteraction of the virtual object with the three dimensional model; inwhich the step of generating the virtual three-dimensional modelcomprises in turn the steps of: defining a series of value rangescorresponding to disparity values of the disparity map, each value rangein the series having an end point corresponding to a greater disparitythan an end point of preceding value ranges in the series; selectingpoints in the disparity map falling within the respective value range;generating a respective mesh responsive to those selected points; andmerging the resulting series of generated meshes to form the 3D model ofthe scene; wherein: each respective mesh is within a depth range; andmerging the resulting series of generated meshes to form the 3D model ofthe scene is done across a depth spanned by the depth ranges of therespective meshes wherein the merged 3D model of the scene is made up ofa continuous geometry.
 11. An entertainment device for augmenting afirst stereoscopic image comprising a pair of images, the entertainmentdevice comprising: input means for receiving the first stereoscopicimage data; disparity processing means for generating a disparity mapfrom the pair of images of the first stereoscopic image, the disparitymap being indicative of distances in the first stereoscopic image;virtual modelling means for generating a virtual three-dimensional modelcomprising a mesh based upon the distances indicated by the disparitymap; interaction modelling means for modeling an interaction of avirtual object with the three dimensional model, in which the virtualobject has a physical attribute associated with it, and the interactionof the virtual object with the three dimensional model is utilises tothe physical attribute; and output means operable for outputting, fordisplay, an image corresponding to the first stereoscopic image thatcomprises a visible effect of the interaction of the virtual object withthe three dimensional model; in which the virtual modelling means isconfigured to generate the virtual three-dimensional model by: defininga series of value ranges corresponding to disparity values of thedisparity map, each value range in the series having an end pointcorresponding to a greater disparity than an end point of precedingvalue ranges in the series; selecting points in the disparity mapfalling within the respective value range; generating a respective meshresponsive to those selected points; and merging the resulting series ofgenerated meshes to form the 3D model of the scene; wherein: eachrespective mesh is within a depth range; and merging the resultingseries of generated meshes to form the 3D model of the scene is doneacross a depth spanned by the depth ranges of the respective mesheswherein the merged 3D model of the scene is made up of a continuousgeometry.
 12. An entertainment device according to claim 11, comprising:texture generation means for generating at least a first texture fromone or both of the pair of images of the stereoscopic image; texturingmeans for applying the first texture to at least a respective part ofthe three dimensional model to obtain a textured three dimensionalmodel; and rendering means for rendering the textured three dimensionalmodel together with the virtual object.
 13. An entertainment deviceaccording to claim 12, in which the rendering means is operable toperform rendering of the textured three dimensional model with thevirtual object for one or more viewpoints other than those of the pairof images of the first stereoscopic image, so as to generate a new viewof the scene depicted in the first stereoscopic image.